function pbsocialitemsWin() {
	// 城市的下拉框
	var socialCityiditemCombox = new Ext.form.ComboBox({
				fieldLabel : '城市',
				hiddenName :"masFilter.cityId3",
				id : 'masFilter_cityId3',
				store : getCityStore(),
				displayField : 'CITY_NAME',
				valueField : 'CITY_ID',
				typeAhead : true,
				mode : 'remote',
				triggerAction : 'all',
				selectOnFocus : true,
				anchor : '90%',
				forceSelection : true,
				width : 150
			});

	// 省份的下拉框
	var socialProvinceidItem = new Ext.form.ComboBox({
		fieldLabel : '省份',
		hiddenName : "masFilter.provinceId3",
		id : 'masFilter_provinceId3',
		store : getProvinceStore(),
		displayField : 'province_name',
		valueField : 'province_id',
		typeAhead : true,
		mode : 'local',
		triggerAction : 'all',
		selectOnFocus : true,
		anchor : '90%',
		forceSelection : true,
		width : 150,
		listeners : {
			select : function(combo, record, index) {
				cityCombox = Ext.getCmp('masFilter_cityId3')
				cityCombox.reset();
				cityStore = cityCombox.getStore();
				cityStore.proxy = new Ext.data.HttpProxy({
							url : 'City!queryCityByProviceId.action?province_id='
									+ socialProvinceidItem.getValue()
						});

				cityStore.load();
			}
		}
	});

	var itemsPanel = new Ext.form.FormPanel({
				frame : true,
				id : 'itemsPanel',
				bodyStyle : 'padding:5px 5px 0',
				autoDestroy : false,
				width : 900,
				height : 100,
				buttonAlign : 'right',
				items : [{
							layout : 'column',
							items : [{
										columnWidth : .5,
										layout : 'form',
										items : [socialProvinceidItem, {
													xtype : 'textfield',
													fieldLabel : '社保项目名称',
													name : 'masFilter.socialItemName3',
													id : 'masFilter_socialItemName3',
													anchor : '90%'
												}

										]
									}, {
										columnWidth : .5,
										layout : 'form',
										items : [socialCityiditemCombox, {
													xtype : 'textfield',
													fieldLabel : '所属类别',
													name : 'masFilter.socialTypeName3',
													id : 'masFilter_socialTypeName3',
													anchor : '90%'
												}]
									}]
						}],
				buttons : [{
							text : '查询',
							id : 'continue',
							handler : function() {
								newStore.on('beforeload', function() {
									newStore.baseParams = {
										'masFilter.provinceId' : Ext.getCmp('masFilter_provinceId3').getValue(),
										'masFilter.cityId' : Ext.getCmp('masFilter_cityId3').getValue(),
										'masFilter.socialItemName' : Ext.getCmp('masFilter_socialItemName3').getValue()==null?"":Ext.getCmp('masFilter_socialItemName3').getValue(),
										'masFilter.socialTypeName' : Ext.getCmp('masFilter_socialTypeName3').getValue()==null?"":Ext.getCmp('masFilter_socialTypeName3').getValue()
									}
								});
								newStore.load();
							}
						}, {
							text : '确认',
							id : 'continue',
							handler : function() {
								var recordLength = itemsGrid.getSelectionModel().getSelections().length;
								if (recordLength > 0) {
									var add = 0, ducp = 0;
									var ss = [];
									var add_data = [], ducp_data = [];
									var selectRecords = itemsGrid.getSelectionModel().getSelections();
									var selectLength = selectRecords.length;
									for(var j = 0; j < selectLength; j++){
										var index = newStore2.find('socialItemId', selectRecords[j].data.socialItemId);
										if(index == -1){
											ss.push(selectRecords[j]);
											add_data.push(selectRecords[j].data.socialItemName);
											add++;
										}else{
											ducp_data.push(selectRecords[j].data.socialItemName);
											ducp++;
										}
									};
									
									if(ducp!=0){
										if (add == 0) {
											Ext.Msg.alert("警告","看上去您选择的社保项目都已经添加过了，请重新选择!")
										}else{
											Ext.MessageBox.confirm('确认添加', '您要添加的' + recordLength
														+ '条社保项目有' + ducp + '条已经存在，是否把未重复的'
														+ add + '条添加进去？\n重复的社保项目名称为：\"'+ducp_data.join(",")+'\"。', function(btn) {
												if (btn == "yes") {
													for (var i = 0; i < ss.length; i++) {
														newStore2.add(ss[i]);
													}
													itemsGrid.getStore().removeAll();
													Ext.getCmp('itemWin').hide();
												}
											});
										}
									}else{
										Ext.MessageBox.confirm('确认添加', '请确认要添加'+add+'条社保项目？', function(btn) {
											if (btn == "yes") {
												for(var i = 0;i<ss.length;i++){
													newStore2.add(ss[i]);
												}
												itemsGrid.getStore().removeAll();
												Ext.getCmp('itemWin').hide();
											}
										});
									}
									
									
								} else {
									Ext.Msg.alert('提示', '请选择要添加的数据项!');
								}
							}
						}, {
							text : '关闭',
							id : 'continue',
							handler : function() {
								itemsGrid.getStore().removeAll();
								Ext.getCmp('itemWin').hide();
							}
						}]
			});

	var newStore = new Ext.data.Store({
				url : 'socialItem!querySocialItemByFilter.action',
				reader : new Ext.data.JsonReader({
							root : 'beanList'
						}, [{
								name : 'socialItemId',
								mapping : 'socialItemId'
							}, {
								name : 'socialItemName',
								mapping : 'socialItemName'
							}, {
								name : 'socialTypeId',
								mapping : 'socialTypeId'
							}, {
								name : 'socialTypeName',
								mapping : 'socialTypeName'
							}, {
								name : 'personBaseValue',
								mapping : 'personBaseValue'
							}, {
								name : 'personRate',
								mapping : 'personRate'
							}, {
								name : 'companyBaseValue',
								mapping : 'companyBaseValue'
							}, {
								name : 'companyRate',
								mapping : 'companyRate'
							}, {
								name : 'personAdd',
								mapping : 'personAdd'
							}, {
								name : 'companyAdd',
								mapping : 'companyAdd'
							}])
			});

	var subCm = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(),
			new Ext.grid.CheckboxSelectionModel(), {
				header : '社保项目名称',
				dataIndex : 'socialItemName',
				width : 100
			}, {
				header : '所属类别',
				dataIndex : 'socialTypeName',
				width : 100
			}, {
				header : '个人基数',
				dataIndex : 'personBaseValue',
				width : 100
			}, {
				header : '企业基数',
				dataIndex : 'companyBaseValue',
				width : 100
			}, {
				header : '个人比例',
				dataIndex : 'personRate',
				width : 100
			}, {
				header : '企业比例',
				dataIndex : 'companyRate',
				width : 100
			},{
				header : '个人附加金额',
				dataIndex : 'personRate',
				width : 100
			}, {
				header : '企业附加金额',
				dataIndex : 'companyRate',
				width : 100
			}]);

	var itemsGrid = new Ext.grid.GridPanel({
		id : "itemsGrid",
		cm : subCm,
		sm : new Ext.grid.CheckboxSelectionModel(),
		height : 200,
		width : 900,
		autoScroll : true,
		viewConfig : {
			width : 800,
			autoScroll : true
		},
		loadMask : true,
		loadMask : {
			msg : '正在加载数据...'
		},
		frame : true,
		clicksToEdit : 1,
		store : newStore
			/*
			 * bbar:new Ext.PagingToolbar({ pageSize:20, store:conditionStore,
			 * displayInfo:true, dispalyMsg:'显示第{0}条到{1}条记录，一共{2}条',
			 * emptyMsg:'没有记录' }),
			 */
		});

	var pbsocialItemWin = new Ext.Window({
				modal : true,
				buttonalign : 'right',
				id : 'itemWin',
				closable : true,
				draggable : true,
				closeAction : 'hide',
				width : 910,
				height : 350,
				top : 10,
				region : 'center',
				plain : true,
				items : [itemsPanel,itemsGrid],
				title : '模板信息',
				listeners : {
					"beforedestroy" : function(obj) {
						// obj.hide();
						return true;
					},
					"beforeshow" : function(obj) {
						// deletedJson = [];
						return true;
					},
					"beforehide" : function(obj) {
						itemsPanel.getForm().reset();
						//newStore.loadData(Ext.util.JSON.decode("[]"),false);
						//newStore.load();
						return true;
					}
				}

			});

	return pbsocialItemWin;
};